package com.taotao.portal.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import com.taotao.pojo.TbItem;
import com.taotao.portal.service.IItemService;

@Controller
@RequestMapping("/item")
public class ItemController {
	@Autowired
	private IItemService itemService;

	@RequestMapping("/{itemId}")
	public String getItemInfoByItemId(@PathVariable Long itemId, Model model) {
		if (null != itemId) {
			TbItem item = this.itemService.getItemInfoByItemId(itemId);
			model.addAttribute("item", item);
			return "item";
		}
		return null;

	}
}
